const express = require('express')
const router = express.Router()
const emp_hander = require('../router_hander/emp')
//引入schema模块
const {reg_regempadd_schema} = require('../schema/index')
//引入@escook/express-joi 模块
const expressJoi = require('@escook/express-joi')
//查询所有员工信息
router.get('/emp/userinfo/:page/:limit',emp_hander.reqEmpUserInfo)
//查询员工在职信息
router.get('/emp/useemp/:page/:limit',emp_hander.reqSelectUseEmp)
//查询员工离职信息
router.get('/emp/dnotuseemp/:page/:limit',emp_hander.reqSelectDnotUseEmp)
//添加员工
router.post('/emp/addemp',expressJoi(reg_regempadd_schema),emp_hander.reqAddEmp)
//在职模糊查询
router.post('/emp/fuzzyselect/:page/:limit',emp_hander.reqFuzzySelect)
//离职模糊查询
router.post('/emp/dnotfuzzyselect/:page/:limit',emp_hander.reqDnotFuzzySelect)
//员工编辑
router.post('/emp/editemp',emp_hander.reqEditEmp)
//员工删除
router.get('/emp/deleteemp/:eid',emp_hander.reqDeleteEmp)
//员工撤销
router.get('/emp/dontdeleteemp/:eid',emp_hander.reqDontDeleteEmp)
module.exports = router